function resizeContent(){
	var contentSize = $("#content").width();
	var bodyWidth = $("body").width();
	var bodyHeight = $(window).height();

	if(contentSize < 1000){
		$("#content").width(1000);		
	}else if(bodyWidth >= 1000){
		$("#content").width("100%");
	}

	if(bodyHeight < 500){
		$("#box_content").height(385);
	}else{
		var topHeight = 126;
		$("#box_content").height(bodyHeight - topHeight);
	}
}

$(window).resize(function() {
	resizeContent();
});

$(document).ready(function() {	
	resizeContent();
	getBurndown(0);

	$("#actual_sprint").change(function(){
		getBurndown($(this).val());
	});
});


function getBurndown(idSprint){
	$.ajax({
		url: SITE+"app/Views/V_Graphic.php?f=getBurndown&idSprint="+idSprint,
		async: false,
		success: function(data){
			var obj = JSON.decode(data);
			if(obj[0]){
				$("#box_content").html("<img src="+obj[1]+">");
			}else{
				resultMensage(obj, true);
			}			
		}	
	});
}